<!--  -->
<template>
  <div class="demo_warp">
    <div>
      <div class="header-add">
        <div class="left-content">
          <div>
            <div class="title-warps" style="margin-left: 0px">所属板块</div>
            <el-select size="mini" @change='querydatas' v-model="form_data.name" placeholder="请选择">
              <el-option
                v-for="item in plateNamesarr"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </div>
          <div>
            <div class="title-warps">更新频率</div>
            <el-select size="mini" @change='querydatas' v-model="form_data.dim" placeholder="请选择">
              <el-option
                v-for="item in dimarr"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </div>
          <div>
            <div class="title-warps">来源</div>
            <el-select size="mini" @change='querydatas' v-model="form_data.source" placeholder="请选择">
              <el-option
                v-for="item in schemaType_arr"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </div>
          <div>
            <div class="title-warps">指标名称</div>
            <el-input
              size="mini"
              @change='querydatas'
              v-model="form_data.fieldName"
              placeholder="请输入内容"
            ></el-input>
          </div>
          <div>
            <div class="title-warps">创建人</div>
            <el-input
              size="mini"
              @change='querydatas'
              v-model="form_data.createUser"
              placeholder="请输入内容"
            ></el-input>
          </div>
          <div style="width: 200px">
            <el-button class="query-btn" size="mini" @click="querydata"
              >查询</el-button
            >
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    blur: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
        form_data:{
            name:'',
            dim:'',
            source:'',
            fieldName:'',
            createUser:'',
        },
        //组件参数，无用
         plateNamesarr: [
        {
          value: "-1",
          label: "全部",
        },
        {
          value: "4",
          label: "金融数据",
        },
        {
          value: "1",
          label: "货币政策立场",
        },
        {
          value: "2",
          label: "货币政策操作",
        },
        {
          value: "3",
          label: "金融市场流动性",
        },
        {
          value: "5",
          label: "海外市场流动性",
        },
      ],
      dimarr: [
         {
          value: "-1",
          label: "全部",
        },
        {
          value: "1",
          label: "年频",
        },
         {
          value: "4",
          label: "季频",
        },
        {
          value: "2",
          label: "月频",
        },
         
       
        {
          value: "5",
          label: "周频",
        },
        {
          value: "3",
          label: "日频",
        },
        
      ],
       schemaType_arr:[
        {
          value: "-1",
          label: "全部",
        },
        {
          value: "1",
          label: "爬虫",
        },
        {
          value: "2",
          label: "Wind",
        },
        {
          value: "3",
          label: "预测模型",
        },
        {
          value: "4",
          label: "手动创建",
        },
      ],
    };
  },

  components: {},

  computed: {},

  mounted() {},

  methods: {
      querydata(){
          this.$emit('seatch_fun',this.form_data);
          return false;
      },
      querydatas(){
        console.log(this.blur)
          if(this.blur){
            this.$emit('seatch_fun',this.form_data);
          }
          return false;
      }
  },
};
</script>
<style lang='scss' scoped>
.demo_warp {
  width: 100%;
  height: 200px;
  display: flex;
  justify-content: center;
  > div {
    min-width: 500px;
    display: flex;
    > div {
      display: flex;
    }
  }
  .left-content {
    display: flex;
    > div {
      display: flex;
      align-items: center;
      font-size: 14px;
      white-space: nowrap;
    }
  }
}
</style>